﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Shut;
using System.IO;
using System.Text;

public partial class css_ui_css : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
	

		string cssFolder = Server.MapPath(SiteSettings.Instance.DevLocation);
		string mediacss = "@media only screen and (max-width: {0}px)";
		string strOut = "";

		foreach (string file in Directory.GetFiles(cssFolder, "sh.media.*.css", SearchOption.TopDirectoryOnly))
		{
			FileInfo info = new FileInfo(file);
			
			strOut += String.Format(mediacss, info.Name.Split(new char[]{'.'})[3]) +"{";
			// open file


			using (StreamReader sr = new StreamReader(file))
			{
				string line;
				
				while ((line = sr.ReadLine()) != null)
				{
					strOut += line + "\n";
				}
				strOut += "} \n"; // close media query
			}
		}
		ltMedias.Text = strOut;

		if (Request.QueryString["d"] == "rtl")
		{
			plRTL.Visible = true;
		}

    }
	protected string Ui_GetVersion(){
		return Utils.GetVersion();
	}
}